package com.yeyks.app.controller.base.consumer;

import com.yeyks.activity.param.ActivityNodeUserRecordSaveByActivityParam;
import com.yeyks.activity.service.ActivityNodeUserRecordService;
import com.yeyks.app.annotation.LoadUserId;
import com.yeyks.common.ajax.AjaxResponseBody;
import com.yeyks.common.param.consumer.UserIdParam;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "非重复记录", description = "非重复记录")
@RestController
@RequestMapping("/app/user/once/done")
public class UserOnceDoneController {

    @Autowired
    private ActivityNodeUserRecordService activityNodeUserRecordService;

    //第一次登录展示的图片
    private static final String USER_LOGIN_FIRST = "user_login_first";

    @ApiOperation(value = "第一次登录展示的图片v3.8.1", notes = "true展示，false不展示")
    @PostMapping("/get/cover")
    public AjaxResponseBody<Boolean> getCover(@LoadUserId UserIdParam param) {
        ActivityNodeUserRecordSaveByActivityParam activityNodeUserRecordSaveByActivityParam = new ActivityNodeUserRecordSaveByActivityParam();
        activityNodeUserRecordSaveByActivityParam.setUserId(String.valueOf(param.getUserId())).setActivityCode(USER_LOGIN_FIRST).setNode("cover");
        Boolean aBoolean = activityNodeUserRecordService.saveByActivity(activityNodeUserRecordSaveByActivityParam);
        return AjaxResponseBody.success(aBoolean);
    }

}
